import { nextTick } from "@tarojs/taro";
import { computed } from "vue";

export const useFieldHook = (ctx, fieldValue: any) => {
  const value = computed({
    get: () => fieldValue,
    set: (v) => {
      nextTick(() => {
        ctx.emit("field-change", v);
      });
    },
  });

  return value;
};
